A subprogram whose declined draws outnumber its trials fails by name; a dummy handed to what might write it is not read-only - #33
Open
chenyueqi wants to merge 2 commits into
Conversation
… a dummy handed to what might write it is not read-only Three rows of #32 (12, 13, 14), all on main since #30 merged. * The differential gate declines a draw the candidate stops or overruns on (a translated ERROR STOP, a subscript past a dummy's extent) and one both sides take to NaN, and draws again. It did so up to 24 times per trial, counted the redraws in a per-subprogram metric nobody repeated, and passed once one draw survived -- so a translation that stopped on inputs the source accepts passed on the survivors, one at a time. Now a subprogram whose declined draws outnumber the trials it was compared on fails by name, with the count, the reason of each decline (error stop, subscript past extent, NaN on both sides) and the remedy: narrow the draw with `ranges` or pin `dims`. The reshaped rule, which names the extent, still speaks first. A passing verdict repeats the declined count and reasons in its detail; the per-subprogram metrics carry `declined` by reason beside `redrawn`. * Read-only intent inference took a parenthesised reference whose base is not one of this file's subprograms for a subscript, and never walked a function reference, an internal WRITE or an ASSOCIATE. A dummy modified through a use-associated function -- which parses exactly like a subscript -- was inferred `intent(in)`, dropped from the wrapper's outputs and compared on neither side. The pass now knows the scope's variables (dummies, locals, local parameters, module state); a base it does not name is a call whose variable actuals escape, an expression actual is a temporary and does not, and the WRITE unit and the ASSOCIATE selector escape. What cannot be proved read-only stays UNKNOWN, and the gate keeps refusing the routine by name, as it did before #30. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYzzevwvTuLBMYjzdHUhGg
minpack's chkder takes two of the eight values the default integer range draws for mode, and was compared on the survivors: 19 draws declined against 10 trials. It is now named in the unit's detail with the reason and the remedy (pin mode with `ranges`); the unit was already failed on dogleg's moved extents. No other unit moves; the per-subprogram metrics gain `declined` by reason. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYzzevwvTuLBMYjzdHUhGg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes rows 12, 13 and 14 of #32 -- the three that were on main, from #30.
Declined draws are bounded and repeated (rows 12, 13).
differential.bitexactdeclines a draw the candidate stops or overruns on (SystemExit,IndexError) and one both sides take to NaN, and draws again. It did so up to 24 times a trial, counted the redraws in a per-subprogram metric nothing repeated, and passed once one draw survived: a translation that stopped on inputs the source accepts passed on the survivors. Now:error stop,subscript past extent,NaN on both sides) and the remedy (ranges, ordims). The reshaped rule, which names the extent, still speaks first.declinedby reason besideredrawn.The whole-trial NaN redraw is kept -- what both sides do after a NaN is the compiler's scheduling -- but it is now counted against the same bound and said aloud.
Read-only is proved, not assumed (row 14).
_infer_read_only_intentstook a parenthesised reference whose base is not one of this file's subprograms for a subscript, and never walked a function reference, an internal WRITE or an ASSOCIATE; a dummy modified through a use-associated function, which parses exactly like a subscript, was inferredintent(in), dropped from the wrapper's outputs and compared on neither side. The pass now knows the scope's variables (dummies, locals, local parameters, module state): a base it does not name is a call whose variable actuals escape, an expression actual is a temporary and does not, the WRITE unit and the ASSOCIATE selector escape. What cannot be proved read-only stays UNKNOWN, and the gate refuses the routine by name, as before #30.Held to: full suite (916), mypy, ruff green. Corpus re-run: no unit moves (31/67 mechanical, 433 deferred); minpack's
chkderis now named in its unit's detail (19 draws declined, 19 error stop, against 10 trials --modetakes two of the eight default integer values), a unit already failed on dogleg's moved extents. The intent tightening moves nothing in the corpus.Tests: the redraw tests now assert the reason and the verdict's mention of it; two new ones hold the bound for an error stop and for NaN; one new interface test holds each escape (function actual, internal WRITE, ASSOCIATE) and each non-escape (array subscript, expression actual).
🤖 Generated with Claude Code
https://claude.ai/code/session_01HYzzevwvTuLBMYjzdHUhGg